doctype html
html
	head
		meta(charset="utf-8")
		meta(name="viewport",content="width=device-width, initial-scale=1.0, maximum-scale=1.0")
		title Login
		link(type="text/css",rel="stylesheet",href="/public/adminEx/css/style.css")
		link(type="text/css",rel="stylesheet",href="/public/adminEx/css/style-responsive.css")

	body(class="login-body")
		form(name="loginForm",class="form-signin",method="post",action="/doLogin")
			div(class="form-signin-heading text-center")
				h1(class="sign-title") Sign In
				img(src="/public/adminEx/images/login-logo.png")
			div(class="login-wrap")
				input(id="#username",name="username",type="text",class="form-control",placeholder="User Name",autofocus)
				input(id="password",name="password",type="password",class="form-control",placeholder="Password")
				button(type="button",class="btn btn-lg btn-login btn-block",id="loginBtn")
					i(class="fa fa-check")

		script(src="/public/adminEx/js/jquery-1.10.2.min.js")
		script(src="/public/adminEx/js/bootstrap.min.js")
		script(src="/public/adminEx/js/modernizr.min.js")
		script(src="/public/js/layer/layer.js")
		script.
			$(function() {
				$("#loginBtn").click(function() {
					doLogin();					
				});
				$("[class='form-control']").keydown(function(e) {
					if (e.keyCode == 13) doLogin();
				});

				function doLogin() {
					if ($("#username").val() == "") { layer.alert('用户名不能为空！', {icon: 0}); return; }
					if ($("#password").val() == "") { layer.alert('密码不能为空！', {icon: 0}); return; }
					document.loginForm.submit();
				}
			});